home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / filesyst / umsdos / linux-1.31 < prev    next >
Internet Message Format  |  1996-11-17  |  3KB

  1. From mday@park.uvsc.edu Tue Jul 19 21:51:47 EDT 1994
  2. Article: 12364 of comp.os.linux.development
  3. Newsgroups: comp.os.linux.development
  4. Path: bigblue.oit.unc.edu!concert!gatech!newsxfer.itd.umich.edu!sol.ctr.columbia.edu!news.kei.com!news.byu.edu!hamblin.math.byu.edu!park.uvsc.edu!mday
  5. From: mday@park.uvsc.edu (Matt Day)
  6. Subject: Re: Patchlevel 31 breaks UMSDOS [FIX]
  7. Organization: Utah Valley State College, Orem, Utah
  8. Date: Wed, 20 Jul 1994 03:23:09 GMT
  9. Message-ID: <Ct7yqo.3H1@park.uvsc.edu>
  10. References: <Ct7AE9.Fn7@ucdavis.edu>
  11. Lines: 96
  12.  
  13. In article <Ct7AE9.Fn7@ucdavis.edu> slouken@cs.ucdavis.edu (Sam Oscar Lantinga) writes:
  14. >    The file linux/fs/msdos/mmap.c from the UMSDOS distribution
  15. >contains references to share_map(), which no longer exists in patchlevel 31.
  16. >It should be an easy fix, but I don't know where to start.
  17.  
  18. This patch gets UMSDOS 3.0 running on Linux 1.1.31:
  19.  
  20. --- fs/msdos/mmap.c-    Tue Jul 19 16:13:06 1994
  21. +++ fs/msdos/mmap.c    Tue Jul 19 17:36:14 1994
  22. @@ -19,13 +19,6 @@
  23.  #include <asm/system.h>
  24.  #include <linux/msdos_fs.h>
  25.  
  26. -extern int share_page(struct vm_area_struct * area, struct task_struct * tsk,
  27. -    struct inode * inode, unsigned long address, unsigned long error_code,
  28. -    unsigned long newpage);
  29. -
  30. -extern unsigned long put_page(struct task_struct * tsk,unsigned long page,
  31. -    unsigned long address,int prot);
  32. -
  33.  extern void file_mmap_free(struct vm_area_struct * area);
  34.  extern int file_mmap_share(struct vm_area_struct * from, struct vm_area_struct * to,
  35.                  unsigned long address);
  36. @@ -33,33 +26,20 @@
  37.  /*
  38.      Perform the mapping of an adresse in memory
  39.  */
  40. -static void msdos_file_mmap_nopage(
  41. -    int error_code,
  42. +static unsigned long msdos_file_mmap_nopage(
  43.      struct vm_area_struct * area,
  44. -    unsigned long address)
  45. +    unsigned long address,
  46. +    unsigned long page,
  47. +    int error_code)
  48.  {
  49.      struct inode * inode = area->vm_inode;
  50.      unsigned int clear;
  51. -    unsigned long page;
  52.      int pos;
  53.      long gap;    /* distance from eof to pos */
  54.  
  55.      address &= PAGE_MASK;
  56.      pos = address - area->vm_start + area->vm_offset;
  57.  
  58. -    page = __get_free_page(GFP_KERNEL);
  59. -    if (share_page(area, area->vm_task, inode, address, error_code, page)) {
  60. -        ++area->vm_task->mm->min_flt;
  61. -        return;
  62. -    }
  63. -
  64. -    ++area->vm_task->mm->maj_flt;
  65. -    if (!page) {
  66. -        oom(current);
  67. -        put_page(area->vm_task, BAD_PAGE, address, PAGE_PRIVATE);
  68. -        return;
  69. -    }
  70. -
  71.      clear = 0;
  72.      gap = inode->i_size - pos;
  73.      if (gap <= 0){
  74. @@ -78,30 +58,19 @@
  75.          if (cur_read != need_read){
  76.              printk ("MSDOS: Error while reading an mmap file %d <> %d\n"
  77.                  ,cur_read,need_read);
  78. -            free_page (page);
  79. -            oom(current);
  80. -            put_page(area->vm_task, BAD_PAGE, address, PAGE_PRIVATE);
  81. -            return;
  82.          }
  83.      }
  84. -    if (!(error_code & PAGE_RW)) {
  85. -        if (share_page(area, area->vm_task, inode, address, error_code, page))
  86. -            return;
  87. -    }
  88.      if (clear > 0){
  89. -        #if 1
  90. +#if 1
  91.              memset ((char*)page+PAGE_SIZE-clear,0,clear);
  92. -        #else
  93. +#else
  94.              unsigned long tmp = page + PAGE_SIZE;
  95.              while (clear--) {
  96.                  *(char *)--tmp = 0;
  97.              }
  98. -        #endif
  99. +#endif
  100.      }
  101. -    if (put_page(area->vm_task,page,address,area->vm_page_prot))
  102. -        return;
  103. -    free_page(page);
  104. -    oom(current);
  105. +    return page;
  106.  }
  107.  struct vm_operations_struct msdos_file_mmap = {
  108.      NULL,            /* open */
  109.  
  110.  
  111.